<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.inc" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript">
<!--
	function back(){
		var uri = "./customerManage.do";
		var sign = "<c:out value='${sign}'/>";
		if(sign == "11"){
			uri = "./customerManage.do";//返回客户资料页面
		}else if(sign == "12"){
			uri = "./customerManage.do?action=deptCustomer";//返回部门客户资料页面
		}else if(sign == "21"){
			uri = "./contractCustomer.do";//返回签约客户页面
		}else if(sign == "22"){
			uri = "./contractCustomer.do?action=deptCustomer";//返回部门签约客户页面
		}else if(sign == "31"){
			uri = "./exceptionCustomer.do";//返回异动客户页面
		}else if(sign == "41"){
			uri = "./assignCustomer.do";//返回指派客户页面
		}else if(sign == "51"){
			uri = "./repeatCustomer.do";//返回报备管理页面
		}else if(sign == "61"){
			uri = "./customerCollect.do";//返回客户收集页面
		}else if(sign == "71"){
			uri = "./saleRecord.do";//返回销售日志页面
		}else if(sign == "81"){
			uri = "./saleFunnel.do";//返回销售漏斗页面
		}else if(sign == "91"){
			uri = "./saleRecord.do?action=deptSaleRecord";//返回部门销售日志页面
		}else if(sign == "101"){
			uri = "./myRecycleBin.do";//返回客户管理－回收站页面
		}else if(sign == "111"){
			uri = "./teamRecycleBin.do";//返回团队管理－回收站页面
		}else if(sign == "121"){
			uri = "./scheduleManage.do";//返回今日日程安排页面
		}else if(sign == "131"){
			uri = "./scheduleManage.do?action=weekSchedule";//返回本周日程安排页面
		}else if(sign == "141"){
			uri = "./scheduleManage.do?action=monthSchedule";//返回本月日程安排页面
		}else if(sign == "288"){
				uri = "./manageReport.do?action=CustomerStatisticContract";
		}else if(sign == "122"){
				uri = "./customerManage.do?action=getDeptNameCustomer";
		}else if(sign == "124"){
				uri = "./customerManage.do?action=getOwnNameCustomer";
		}else if(sign == "125"){
			uri = "./linkman.do?action=deptCustomerLinkMan";
		}else if(sign == "126"){
			uri = "./linkman.do?action=ownCustomerLinkMan";
		}else if(sign == "127"){
			uri = "./customerManage.do?action=myShareCustomer";
		}else if(sign == "128"){
			uri = "./customerManage.do?action=nearViewCustomer";
		}else if(sign == "129"){
			uri = "./customerManage.do?action=nearUpdatedCustomer";
		}else if(sign == "150"){
			uri = "./customerManage.do?action=deptSaleRecordCustomer";
		}else if(sign == "151"){
			uri = "./customerManage.do?action=deptSucceedContract";
		}else if(sign == "152"){
			uri = "./customerManage.do?action=deptHangupBusinessOpportunity";
		}else if(sign == "153"){
			uri = "./customerManage.do?action=deptGiveupBusinessOpportunity";
		}else if(sign == "154"){
			uri = "./customerManage.do?action=mySucceedContract";
		}else if(sign == "155"){
			uri = "./customerManage.do?action=myHangupBusinessOpportunity";
		}else if(sign == "156"){
			uri = "./customerManage.do?action=myGiveupBusinessOpportunity";
		}else if(sign == "157"){
			uri = "./customerManage.do?action=nearChangedBusinessOpportunity";
		}else if(sign == "158"){
			uri = "./customerManage.do?action=nearFollowedBusinessOpportunity";
		}
		window.location.href = uri;
		window.location.target = "main";
	}
	
	function viewLinkmanInfo(){
		var customerId = "<c:out value='${customer.id}'/>";
		var sign = "<c:out value='${sign}'/>";
		window.location.href = "./linkman.do?action=linkmanInfo&customerId="+customerId+"&sign="+sign;
		window.location.target = "main";
	}
	
	function viewSaleInfo(){
		var customerId = "<c:out value='${customer.id}'/>";
		var sign = "<c:out value='${sign}'/>";
		window.location.href = "./customerManage.do?action=viewSaleInfo&customerId="+customerId+"&sign="+sign;
		window.location.target = "main";
	}
	
	function viewCustomerUpdateHistory(){
		var customerId = "<c:out value='${customer.id}'/>";
		var sign = "<c:out value='${sign}'/>";
		window.location.href = "./customerManage.do?action=customerUpdateHistory&customerId="+customerId+"&sign="+sign;
		window.location.target = "main";
	}
	
	function viewLinkmanUpdateHistory(){
		var customerId = "<c:out value='${customer.id}'/>";
		var sign = "<c:out value='${sign}'/>";
		window.location.href = "./linkman.do?action=linkmanUpdateHistory&customerId="+customerId+"&sign="+sign;
		window.location.target = "main";
	}
	
	function viewHistoryUpdate(){
		window.location.href = "viewHistoryUpdate.html";
		window.location.target = "main";
	}
	
	function viewSaleRecord(){
		var customerId = "<c:out value='${customer.id}'/>";
		var sign = "<c:out value='${sign}'/>";
		window.location.href = "./saleRecord.do?action=viewSaleRecord&customerId="+customerId+"&sign="+sign;
		window.location.target = "main";
	}
	
	function addCustomer(){
		//var sign = "<c:out value='${sign}'/>";
		if("<c:out value='${notAdd}'/>" == 1){
			alert("<fmt:message key='customer.message.overstep'/>");
		}else{
			//window.location.href = "./customerManage.do?action=preAddCustomer&sign="+sign;
			window.location.href = "./customerManage.do?action=preAddCustomer";
			window.location.target = "main";
		}
	}
	
	function updateCustomer(){
		var customerId = "<c:out value='${customer.id}'/>";
		var sign = "<c:out value='${sign}'/>";
		window.location.href = "./customerManage.do?action=preUpdateCustomer&id="+customerId+"&sign="+sign;
		window.location.target = "main";
	}
	
	function discardCustomer(){
		var untappedDisNum = "<c:out value='${discardLimitNum.untappedCustomerNum}'/>";
		var isExpUser = "<c:out value='${isExpUser}'/>";
		var customerId = "<c:out value='${customer.id}'/>";
		var sign = "<c:out value='${sign}'/>";
		if(confirm("确定要删除当前客户吗？")){
			if(isExpUser == '1' || 1 <= untappedDisNum){
				window.location.href = "./customerManage.do?action=discardCustomer&id="+customerId+"&sign="+sign;
				window.location.target = "main";
			}else if(untappedDisNum <= 0){
				alert("<fmt:message key='customer.message.overstepDiscard'/>");
			}else{
				alert("<fmt:message key='customer.message.currentDiscard'/>"+untappedDisNum+"<fmt:message key='customer.message.num'/>");
			}
		}
		
	}

	/**
	function discardCustomer(){
		var untappedDisNum = "<c:out value='${discardLimitNum.untappedCustomerNum}'/>";
		var isExpUser = "<c:out value='${isExpUser}'/>";
		if(confirm("确定要删除选中客户吗？") && checkForm()){
			var objs = document.getElementsByName("id");
			var sign = 0;
			for(var i = 0; i < objs.length; i++){
				if(objs[i].value != 0 && objs[i].checked){
					var id = objs[i].value;
					var isDelete = document.getElementById("del_"+id);
					if(isDelete.value == 'false'){
						var customerName = document.getElementById("customer_"+id);
						alert(customerName.value + " 是被共享客户不能删除!");
						break;
					}else{
						sign = sign + 1;
					}
				}
			}
		
			if(sign > 0){
				if(isExpUser == '1' || sign <= untappedDisNum){
					document.customerInfoForm.action = "./customerManage.do?action=discardCustomer";
					document.customerInfoForm.target = "main";
					document.customerInfoForm.submit();
					
				}else if(untappedDisNum <= 0){
					alert("<fmt:message key='customer.message.overstepDiscard'/>");
				}else{
					alert("<fmt:message key='customer.message.currentDiscard'/>"+untappedDisNum+"<fmt:message key='customer.message.num'/>");
				}
			} 
		}
		
	}
	*/
	
	function addLinkman(){
		var customerId = "<c:out value='${customer.id}'/>";
		var sign = "<c:out value='${sign}'/>";
		window.location.href = "./linkman.do?action=preAddLinkman&customerId="+customerId+"&sign="+sign;
		window.location.target = "main";
	}
	
	function updateLinkman(){
		var customerId = "<c:out value='${customer.id}'/>";
		var sign = "<c:out value='${sign}'/>";
		window.location.href = "./linkman.do?action=preUpdateLinkman&customerId="+customerId+"&sign="+sign;
		window.location.target = "main";
	}
	
	function deleteLinkman(linkmanId){
		var customerId = "<c:out value='${customer.id}'/>";
		var sign = "<c:out value='${sign}'/>";
		if(confirm("确定要删除该联系人吗？")){
			window.location.href = "./linkman.do?action=deleteLinkman&customerId="+customerId+"&sign="+sign+"&id="+linkmanId;
			window.location.target = "main";
		}
	}
	
	function addSaleRecordOne(){
		var customerId = "<c:out value='${customer.id}'/>";
		var sign = "<c:out value='${sign}'/>";
		window.location.href = "./saleRecord.do?action=preAddSaleRecordOne&customerId="+customerId+"&sign="+sign;
		window.location.target = "main";
	}
	
	function updateSaleRecord(){
		var customerId = "<c:out value='${customer.id}'/>";
		var sign = "<c:out value='${sign}'/>";
		window.location.href = "./saleRecord.do?action=preUpdateSaleRecord&customerId="+customerId+"&sign="+sign;
		window.location.target = "main";
	}
	
	function downloadAdded(saleRecordId,addedId){
		var customerId = "<c:out value='${customer.id}'/>";
		//window.location.href = "./saleRecord.do?action=download&customerId="+customerId+"&saleRecordId="+saleRecordId+"&added="+addedId;
		//window.location.target = "main";
		document.customerDetailForm.action = "./saleRecord.do?action=download&customerId="+customerId+"&saleRecordId="+saleRecordId+"&added="+addedId;
		document.customerDetailForm.target = "main";
		document.customerDetailForm.submit();
	}
	
	function showHidden(id){
		var obj = document.getElementById(id);
		if(obj.style.display == "none"){
			document.getElementById(id).style.display = "block";
			document.getElementById("img"+id).src = "./images/nolines_minus.gif";
		}else{
			document.getElementById(id).style.display = "none";
			document.getElementById("img"+id).src = "./images/nolines_plus.gif";
		}
	}
	
	function initPage(){
		if("<c:out value='${result}'/>" == 1){
			alert("删除成功！");
		}
	}
-->
</script>
</head>
<body onload="initPage()">
<form name="customerDetailForm" action="" method="post">
	<table class="table_frame" cellpadding="0" cellspacing="0">
		<tr>
			<td>
				<table class="table_title1">
					<tr>
						<td class="title_lab">客户资料全貌</td>
					</tr>
					<tr>
						<td align="center" valign="bottom">
							<button class="btn_back" onclick="back()" hidefocus="true">返回</button>
						</td>
					</tr>
					<tr><td height="2"></td></tr>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top">
				<table class="table_title2" cellpadding="0" cellspacing="0">
					<tr>
						<td class="page_title1">&nbsp;${customer.customerName}</td>
					</tr>
					<tr>
						<td class="title_info">
							<table class="table" style="width: 800px;">
								<tr>
									<td width="30" valign="middle" onclick="showHidden('1')">&nbsp;<img id="img1" src="./images/nolines_minus.gif"></td>
									<td width="150">客户详细信息</td>
									<td>
										<c:if test="${isAddCustomer == 1}">
										<input class="btn1" type="button" value=" 新 增 " onclick="addCustomer()"/>&nbsp;&nbsp;
										</c:if>
										<c:if test="${isUpdateCustomer == 1 && customer.isWrite == '1'}">
										<input class="btn1" type="button" value=" 编 辑 " onclick="updateCustomer()"/>&nbsp;&nbsp;
										<c:if test="${isDiscardCustomer == '1' && customer.salePersonId == userId}">
										<input class="btn1" type="button" value=" 丢 弃 " onclick="discardCustomer()"/>&nbsp;&nbsp;
										</c:if>
										</c:if>
										<c:if test="${isViewCustomerHistory == 1}">
										<input class="btn1" type="button" value="修改痕迹" onclick="viewCustomerUpdateHistory()"/>
										</c:if>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr id="1">
						<td valign="top">
							<table class="table3" cellpadding="0" cellspacing="0" border="0" width="100%">
								<tr style="display: block;">
									<td align="left">
										<table cellpadding="0" cellspacing="0" border="0" width="100%" height="25">
											<tr>
												<td align="right" width="50" valign="bottom" onclick="showHidden('11')">&nbsp;<img id="img11" src="./images/nolines_minus.gif"></td>
												<td align="left" width="80">关键客户信息</td>
												<td width="670"></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr style="display: block;height: 2px;">
									<td class="line1"></td>
								</tr>
								<tr id="11" style="display: block;">
									<td>
										<table class="table3" cellpadding="0" cellspacing="0" style="display: block;margin: 0 0 0 50px;width: 800px;  word-break:break-all"">
											<tr>
												<td align="right" width="100"><!-- 客户名称 -->
													<c:choose>
														<c:when test="${language == 2}">${records['12'].currentRecordEn}：</c:when>
														<c:otherwise>${records['12'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" colspan="3" width="90%">${customer.customerName}</td>
											</tr>
											<tr>
												<td align="right" width="100"><!-- 总机 -->
													<c:choose>
														<c:when test="${language == 2}">${records['14'].currentRecordEn}：</c:when>
														<c:otherwise>${records['14'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">${customer.phone}</td>
												<td align="right" width="100"><!-- 传真 -->
													<c:choose>
														<c:when test="${language == 2}">${records['15'].currentRecordEn}：</c:when>
														<c:otherwise>${records['15'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left">${customer.fax}</td>
											</tr>
											<tr>
												<td align="right" width="100"><!-- 地址 -->
													<c:choose>
														<c:when test="${language == 2}">${records['13'].currentRecordEn}：</c:when>
														<c:otherwise>${records['13'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td colspan="3" align="left">${customer.address}</td>
											</tr>
											<tr>
												<td colspan="4"></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr style="display: block;">
									<td align="left">
										<table cellpadding="0" cellspacing="0" border="0" width="100%" height="25">
											<tr>
												<td align="right" width="50" valign="bottom" onclick="showHidden('12')">&nbsp;<img id="img12" src="./images/nolines_minus.gif"></td>
												<td align="left" width="80">附加信息</td>
												<td width="670"></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr style="display: block;height: 2px;">
									<td class="line1"></td>
								</tr>
								<tr id="12" style="display: block;">
									<td>
										<table class="table3" cellpadding="0" cellspacing="0" style="display: block; margin: 0 0 0 -40px;  width:100%;  word-break:break-all"">
											<c:if test="${records['110'].status == 1 || records['111'].status == 1}">
											<tr>
												<c:if test="${records['110'].status == 1}">								
												<td align="right" width="100"><!-- 行业 -->
													<c:choose>
														<c:when test="${language == 2}">${records['110'].currentRecordEn}：</c:when>
														<c:otherwise>${records['110'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['110']}">
														<c:if test='${customer.industryId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
												<c:if test="${records['111'].status == 1}">
												<td align="right" width="100"><!-- 区域 -->
													<c:choose>
														<c:when test="${language == 2}">${records['111'].currentRecordEn}：</c:when>
														<c:otherwise>${records['111'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['111']}">
														<c:if test='${customer.areaId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['116'].status == 1 || records['112'].status == 1}">
											<tr>
												<c:if test="${records['116'].status == 1}">
												<td align="right" width="100"><!-- 员工数量 -->
													<c:choose>
														<c:when test="${language == 2}">${records['116'].currentRecordEn}：</c:when>
														<c:otherwise>${records['116'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['116']}">
														<c:if test='${customer.employeeNumId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
												<c:if test="${records['112'].status == 1}">
												<td align="right" width="100"><!-- 产值 -->
													<c:choose>
														<c:when test="${language == 2}">${records['112'].currentRecordEn}：</c:when>
														<c:otherwise>${records['112'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['112']}">
														<c:if test='${customer.outputValueId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['127'].status == 1 || records['113'].status == 1}">
											<tr>
												<c:if test="${records['127'].status == 1}">
												<td align="right" width="100"><!-- 行业细分 -->
													<c:choose>
														<c:when test="${language == 2}">${records['127'].currentRecordEn}：</c:when>
														<c:otherwise>${records['127'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['127']}">
														<c:if test='${customer.subIndustryId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
												<c:if test="${records['113'].status == 1}">
												<td align="right" width="100"><!-- 企业类型 -->
													<c:choose>
														<c:when test="${language == 2}">${records['113'].currentRecordEn}：</c:when>
														<c:otherwise>${records['113'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['113']}">
														<c:if test='${customer.companyTypeId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
											</tr>
											</c:if>	
											<tr>
												<td align="right" width="100"><!-- 客户编号 -->
													<c:choose>
														<c:when test="${language == 2}">${records['11'].currentRecordEn}：</c:when>
														<c:otherwise>${records['11'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="700" colspan="3">
													${customer.customerCode}
													<input id="customerCode" name="customerCode" type="hidden" value="${customer.customerCode}"/>
													<input id="id" name="id" type="hidden" value="${customer.id}"/>
												</td>
											</tr>										
											<c:if test="${records['114'].status == 1 || records['115'].status == 1}">
											<tr>
												<c:if test="${records['114'].status == 1}">
												<td align="right" width="100"><!-- 公司网址 -->
													<c:choose>
														<c:when test="${language == 2}">${records['114'].currentRecordEn}：</c:when>
														<c:otherwise>${records['114'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">${customer.http}</td>
												</c:if>
												<c:if test="${records['115'].status == 1}">
												<td align="right" width="100"><!-- 利润 -->
													<c:choose>
														<c:when test="${language == 2}">${records['115'].currentRecordEn}：</c:when>
														<c:otherwise>${records['115'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['115']}">
														<c:if test='${customer.profitsId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['117'].status == 1 || records['118'].status == 1}">
											<tr>
												<c:if test="${records['117'].status == 1}">
												<td align="right" width="100"><!-- 客户简称 -->
													<c:choose>
														<c:when test="${language == 2}">${records['117'].currentRecordEn}：</c:when>
														<c:otherwise>${records['117'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="700" colspan="3">${customer.customerSimple}</td>
												</c:if>
											</tr>
											<tr>
												<c:if test="${records['118'].status == 1}">
												<td align="right" width="100"><!-- 税号 -->
													<c:choose>
														<c:when test="${language == 2}">${records['118'].currentRecordEn}：</c:when>
														<c:otherwise>${records['118'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="700" colspan="3">${customer.taxCode}</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['119'].status == 1 || records['120'].status == 1}">
											<tr>
												<c:if test="${records['119'].status == 1}">
												<td align="right" width="100"><!-- 开户行 -->
													<c:choose>
														<c:when test="${language == 2}">${records['119'].currentRecordEn}：</c:when>
														<c:otherwise>${records['119'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['119']}">
														<c:if test='${customer.bankDepositId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
												<c:if test="${records['120'].status == 1}">
												<td align="right" width="100"><!-- 邮编 -->
													<c:choose>
														<c:when test="${language == 2}">${records['120'].currentRecordEn}：</c:when>
														<c:otherwise>${records['120'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">${customer.zip}</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['121'].status == 1 || records['122'].status == 1}">
											<tr>
												<c:if test="${records['121'].status == 1}">
												<td align="right" width="100"><!-- 是否上市 -->
													<c:choose>
														<c:when test="${language == 2}">${records['121'].currentRecordEn}：</c:when>
														<c:otherwise>${records['121'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['121']}">
														<c:if test='${customer.isMarketId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
												<c:if test="${records['122'].status == 1}">
												<td align="right" width="100"><!-- 独立采购权 -->
													<c:choose>
														<c:when test="${language == 2}">${records['122'].currentRecordEn}：</c:when>
														<c:otherwise>${records['122'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['122']}">
														<c:if test='${customer.isPurchaseId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['123'].status == 1 || records['124'].status == 1}">
											<tr>
												<c:if test="${records['123'].status == 1}">
												<td align="right" width="100"><!-- 客户类型 -->
													<c:choose>
														<c:when test="${language == 2}">${records['123'].currentRecordEn}：</c:when>
														<c:otherwise>${records['123'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['123']}">
														<c:if test='${customer.customerTypeId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
												<c:if test="${records['124'].status == 1}">
												<td align="right" width="100"><!-- 国家 -->
													<c:choose>
														<c:when test="${language == 2}">${records['124'].currentRecordEn}：</c:when>
														<c:otherwise>${records['124'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['124']}">
														<c:if test='${customer.countryId == range.id}'>${range.CName}</c:if>
													</c:forEach>
												</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['125'].status == 1 || records['126'].status == 1}">
											<tr>
												<c:if test="${records['125'].status == 1}">
												<td align="right" width="100"><!-- 省级 -->
													<c:choose>
														<c:when test="${language == 2}">${records['125'].currentRecordEn}：</c:when>
														<c:otherwise>${records['125'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['125']}">
														<c:if test='${customer.provinceId == range.id}'>${range.CName}</c:if>
													</c:forEach>
												</td>
												</c:if>
												<c:if test="${records['126'].status == 1}">
												<td align="right" width="100"><!-- 市级 -->
													<c:choose>
														<c:when test="${language == 2}">${records['126'].currentRecordEn}：</c:when>
														<c:otherwise>${records['126'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['126']}">
														<c:if test='${customer.cityId == range.id}'>${range.CName}</c:if>
													</c:forEach>
												</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['128'].status == 1 || records['129'].status == 1}">
											<tr>
												<c:if test="${records['128'].status == 1}">
												<td align="right" width="100"><!-- 客户集群 -->
													<c:choose>
														<c:when test="${language == 2}">${records['128'].currentRecordEn}：</c:when>
														<c:otherwise>${records['128'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['128']}">
														<c:if test='${customer.clusterId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
												<c:if test="${records['129'].status == 1}">
												<td align="right" width="100"><!-- 客户规模 -->
													<c:choose>
														<c:when test="${language == 2}">${records['129'].currentRecordEn}：</c:when>
														<c:otherwise>${records['129'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['129']}">
														<c:if test='${customer.scaleId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['130'].status == 1 || records['131'].status == 1}">
											<tr>
												<c:if test="${records['130'].status == 1}">
												<td align="right" width="100"><!-- 母公司 -->
													<c:choose>
														<c:when test="${language == 2}">${records['130'].currentRecordEn}：</c:when>
														<c:otherwise>${records['130'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">${customer.parentCompany}</td>
												</c:if>
												<c:if test="${records['131'].status == 1}">
												<td align="right" width="100"><!-- 自定义母级 -->
													<c:choose>
														<c:when test="${language == 2}">${records['131'].currentRecordEn}：</c:when>
														<c:otherwise>${records['131'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['131']}">
														<c:if test='${customer.customParentId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['132'].status == 1 || records['133'].status == 1}">
											<tr>
												<c:if test="${records['132'].status == 1}">
												<td align="right" width="100"><!-- 自定义子级 -->
													<c:choose>
														<c:when test="${language == 2}">${records['132'].currentRecordEn}：</c:when>
														<c:otherwise>${records['132'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['132']}">
														<c:if test='${customer.customSublevelId == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
												<c:if test="${records['133'].status == 1}">
												<td align="right" width="100"><!-- 自定义分类1 -->
													<c:choose>
														<c:when test="${language == 2}">${records['133'].currentRecordEn}：</c:when>
														<c:otherwise>${records['133'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['133']}">
														<c:if test='${customer.customTypeId1 == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['134'].status == 1 || records['135'].status == 1}">
											<tr>
												<c:if test="${records['134'].status == 1}">
												<td align="right" width="100"><!-- 自定义分类2 -->
													<c:choose>
														<c:when test="${language == 2}">${records['134'].currentRecordEn}：</c:when>
														<c:otherwise>${records['134'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['134']}">
														<c:if test='${customer.customTypeId2 == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
												<c:if test="${records['135'].status == 1}">
												<td align="right" width="100"><!-- 自定义分类3 -->
													<c:choose>
														<c:when test="${language == 2}">${records['135'].currentRecordEn}：</c:when>
														<c:otherwise>${records['135'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['135']}">
														<c:if test='${customer.customTypeId3 == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['136'].status == 1 || records['137'].status == 1}">
											<tr>
												<c:if test="${records['136'].status == 1}">
												<td align="right" width="100"><!-- 自定义分类4 -->
													<c:choose>
														<c:when test="${language == 2}">${records['136'].currentRecordEn}：</c:when>
														<c:otherwise>${records['136'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">${customer.customType4}</td>
												</c:if>
												<c:if test="${records['137'].status == 1}">
												<td align="right" width="100"><!-- 自定义分类5 -->
													<c:choose>
														<c:when test="${language == 2}">${records['137'].currentRecordEn}：</c:when>
														<c:otherwise>${records['137'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">${customer.customType5}</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['138'].status == 1 || records['139'].status == 1}">
											<tr>
												<c:if test="${records['138'].status == 1}">
												<td align="right" width="100"><!-- 自定义分类6 -->
													<c:choose>
														<c:when test="${language == 2}">${records['138'].currentRecordEn}：</c:when>
														<c:otherwise>${records['138'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">${customer.customType6}</td>
												</c:if>
											</tr>
											<tr>
												<c:if test="${records['139'].status == 1}">
												<td align="right" width="100"><!-- 自定义项1 -->
													<c:choose>
														<c:when test="${language == 2}">${records['139'].currentRecordEn}：</c:when>
														<c:otherwise>${records['139'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="70%" colspan="3">${customer.customItem1}</td>
												</c:if>											
											</tr>
											</c:if>
											<c:if test="${records['140'].status == 1 || records['141'].status == 1}">
											<tr>
												<c:if test="${records['140'].status == 1}">
												<td align="right" width="100"><!-- 自定义项2 -->
													<c:choose>
														<c:when test="${language == 2}">${records['140'].currentRecordEn}：</c:when>
														<c:otherwise>${records['140'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="700" colspan="3">${customer.customItem2}</td>
												</c:if>
											</tr>
											<tr>
												<c:if test="${records['141'].status == 1}">
												<td align="right" width="100"><!-- 自定义项3 -->
													<c:choose>
														<c:when test="${language == 2}">${records['141'].currentRecordEn}：</c:when>
														<c:otherwise>${records['141'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="700" colspan="3">
													<textarea name="notes" cols="100" rows="6" readonly>${customer.customItem3}</textarea>
												</td>
												</c:if>											
											</tr>
											</c:if>
											<c:if test="${records['142'].status == 1 || records['143'].status == 1}">
											<tr>
												<c:if test="${records['142'].status == 1}">
												<td align="right" width="100"><!-- 自定义项4 -->
													<c:choose>
														<c:when test="${language == 2}">${records['142'].currentRecordEn}：</c:when>
														<c:otherwise>${records['142'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['142']}">
														<c:if test='${customer.customItemId4 == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
												<c:if test="${records['143'].status == 1}">
												<td align="right" width="100"><!-- 自定义项5 -->
													<c:choose>
														<c:when test="${language == 2}">${records['143'].currentRecordEn}：</c:when>
														<c:otherwise>${records['143'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:forEach var="range" items="${ranges['143']}">
														<c:if test='${customer.customItemId5 == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
												</c:if>
											</tr>
											</c:if>
											<c:if test="${records['144'].status == 1}">
											<tr>
												<td align="right" width="100"><!-- 自定义项6 -->
													<c:choose>
														<c:when test="${language == 2}">${records['144'].currentRecordEn}：</c:when>
														<c:otherwise>${records['144'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300" colspan="3">
													<c:forEach var="range" items="${ranges['144']}">
														<c:if test='${customer.customItemId6 == range.id}'>${range.rangeValue}</c:if>
													</c:forEach>
												</td>
											</tr>
											</c:if>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="2"></td>
		</tr>
		<tr>
			<td valign="top">
				<table class="table_title2">
					<tr>
						<td class="title_info">
							<table class="table" style="width: 800px;">
								<tr>
									<td width="30" valign="middle" onclick="showHidden('2')">&nbsp;<img id="img2" src="./images/nolines_minus.gif"></td>
									<td width="150">联系人信息</td>
									<td>
										<input class="btn1" type="button" value=" 详 情 " onclick="viewLinkmanInfo()"/>&nbsp;&nbsp;
										<c:if test="${isAddCustomer == 1 && customer.isWrite == '1'}">
										<input class="btn1" type="button" value=" 新 增 " onclick="addLinkman()"/>
										</c:if>
										<c:if test="${isViewCustomerHistory == 1}">&nbsp;
										<input class="btn1" type="button" value="修改痕迹" onclick="viewLinkmanUpdateHistory()"/>
										</c:if>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr id="2">
						<td>
							<table class="table_style" cellpadding="0" cellspacing="0" style="width: 800px;">
								<tr>
									<td class="title">操作</td>
									<td class="title">姓名</td>
									<td class="title">职位</td>
									<td class="title">联系人角色</td>
									<td class="title">手机</td>
									<td class="title">电子邮件</td>
								</tr>
								<c:forEach var="linkman" items="${customer.linkmans}">
								<tr>
									<td class="a_detail">
										<c:if test="${isDiscardCustomer == '1' && customer.salePersonId == userId}">
										<a href="javascript:deleteLinkman('${linkman.id}');">删除</a>&nbsp;&nbsp;
										</c:if>
										<c:if test="${isUpdateCustomer == 1 && customer.isWrite == '1'}">
										<a href="javascript:updateLinkman()">编辑</a>&nbsp;&nbsp;
										</c:if>
										<!-- 
										<input id="linkmanId" name="linkmanId" type="checkbox" value="${linkman.id}"/>
										-->
									</td>
									<td>${linkman.linkmanName}</td>
									<td>
										<c:forEach var="range" items="${linkmanRanges['23']}">
											<c:if test="${linkman.linkmanDutyId == range.id}">${range.rangeValue}</c:if>
										</c:forEach>
									</td>
									<td>
										<c:forEach var="range" items="${linkmanRanges['24']}">
											<c:if test="${linkman.itemRoleId == range.id}">${range.rangeValue}</c:if>
										</c:forEach>
									</td>
									<td>${linkman.mobile}</td>
									<td>${linkman.email}</td>
								</tr>
								</c:forEach>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="2"></td>
		</tr>
		<tr>
			<td valign="top">
				<table class="table_title2">
					<tr>
						<td class="title_info">
							<table class="table" style="width: 800px;">
								<tr>
									<td width="30" valign="bottom" onclick="showHidden('3')">&nbsp;<img id="img3" src="./images/nolines_minus.gif"></td>
									<td>销售信息</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr id="3">
						<td valign="top">
							<table class="table3" cellpadding="0" cellspacing="0" border="0" width="100%">
								<tr>
									<td align="left">
										<table cellpadding="0" cellspacing="0" border="0" width="100%" height="25">
											<tr>
												<td align="right" width="50" valign="bottom" onclick="showHidden('31')">&nbsp;<img id="img31" src="./images/nolines_minus.gif"></td>
												<td align="left" width="80">历史交易信息</td>
												<td width="670"></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr style="display: block;height: 2px;">
									<td class="line1"></td>
								</tr>
								<tr id="31">
									<td>
										<table class="table3" cellpadding="0" cellspacing="0" style="display: block;margin: 0 0 0 50px;width: 800px;" border="0">
											<tr>
												<td align="right" width="100">建档时间：</td>
												<td align="left" width="300"><fmt:formatDate value="${customer.createDate}" pattern="yyyy年MM月dd日"/></td>
												<td align="right" width="100">老客户：</td>
												<td align="left">
												<c:choose>
													<c:when test="${saleInfo.historyContractCost != null && saleInfo.historyContractCost > 0}">是</c:when>
													<c:otherwise>否</c:otherwise>
												</c:choose>
												</td>
											</tr>
											<tr>
												<td align="right" width="100">合同数量：</td>
												<td align="left" width="300">${saleInfo.contractNum}个</td>
												<td align="right" width="100">历史合同金额：</td>
												<td align="left" style="color: red;">￥ ${saleInfo.historyContractCost}元</td>
											</tr>
											<tr>
												<td align="right" width="100">应收账款：</td>
												<td align="left" width="300">￥ ${saleInfo.receivable}元</td>
												<td align="right" width="100">开票金额：</td>
												<td align="left">￥ ${saleInfo.invoiceCost}元</td>
											</tr>
											<tr>
												<td align="right" width="100">费用支出：</td>
												<td colspan="3" align="left">￥ ${saleInfo.saleCost}元</td>
											</tr>
											<tr>
												<td colspan="4"></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td align="left">
										<table cellpadding="0" cellspacing="0" border="0" width="100%" height="25">
											<tr>
												<td align="right" width="50" valign="bottom" onclick="showHidden('32')">&nbsp;<img id="img32" src="./images/nolines_minus.gif"></td>
												<td align="left" width="80">商务状态：</td>
												<td width="670"></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr style="display: block;height: 2px;">
									<td class="line1"></td>
								</tr>
								<tr id="32">
									<td>
										<table class="table4" cellpadding="0" cellspacing="0" style="display: block;margin: 0 0 0 50px;width: 800px;">
											<tr>
												<td align="right" width="100"><!-- 客户来源 -->
													<c:choose>
														<c:when test="${language == 2}">${records['16'].currentRecordEn}：</c:when>
														<c:otherwise>${records['16'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left" width="300">
													<c:choose>
														<c:when test="${customer.customerSourceId == 1}"><fmt:message key='customer.select.self'/></c:when>
														<c:when test="${customer.customerSourceId == 2}"><fmt:message key='customer.select.companySet'/></c:when>
														<c:when test="${customer.customerSourceId == 3}"><fmt:message key='customer.select.market'/></c:when>
														<c:otherwise><fmt:message key='customer.select.other'/></c:otherwise>
													</c:choose>
												</td>
												<td align="right" width="100">指派时间：</td>
												<td align="left"><fmt:formatDate value="${customer.assignDate}" pattern="yyyy年MM月dd日"/></td>
											</tr>
											<tr>
												<td align="right" width="100">跟进时间：</td>
												<td align="left" width="300"><fmt:formatDate value="${customer.lastLink}" pattern="yyyy年MM月dd日"/></td>
												<td align="right" width="100">销售阶段：</td>
												<td align="left">${saleInfo.saleStage}</td>
											</tr>
											<tr>
												<td align="right" width="100">销售代表：</td>
												<td align="left" width="300">${customer.salePerson}</td>
												<td align="right" width="100">共享状态：</td>
												<td align="left">${customer.shareSalePersons}</td>
											</tr>
											<tr>
												<td align="right" width="100"><!-- 预测签约 -->
													<c:choose>
														<c:when test="${language == 2}">${records['17'].currentRecordEn}：</c:when>
														<c:otherwise>${records['17'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left"><fmt:formatDate value='${customer.predictContract}' pattern='yyyy-MM-dd'/></td>
												<td align="right" width="100"><!-- 预测金额 -->
													<c:choose>
														<c:when test="${language == 2}">${records['18'].currentRecordEn}：</c:when>
														<c:otherwise>${records['18'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td align="left">￥ 
													<c:choose>
														<c:when test="${customer.predictCost != null}">${customer.predictCost}</c:when>
														<c:otherwise>0.00</c:otherwise>
													</c:choose><fmt:message key='common.lable.yuan'/>
												</td>
											</tr>
											<tr>
												<td colspan="4"></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td align="left">
										<table cellpadding="0" cellspacing="0" border="0" width="100%" height="25">
											<tr>
												<td align="right" width="50" valign="bottom" onclick="showHidden('33')">&nbsp;<img id="img33" src="./images/nolines_minus.gif"></td>
												<td align="left" width="80"><!-- 需求描述 -->
													<c:choose>
														<c:when test="${language == 2}">${records['19'].currentRecordEn}：</c:when>
														<c:otherwise>${records['19'].currentRecord}：</c:otherwise>
													</c:choose>
												</td>
												<td width="670"></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr style="display: block;height: 2px;">
									<td class="line1"></td>
								</tr>
								<tr id="33">
									<td>
										<table class="table4" style="display: block;margin: 0 0 0 50px;width: 800px;">
											<tr>
												<td width="30"></td>
												<td colspan="3" align="left" valign="top"><pre>${customer.requireDesc}</pre></td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="2"></td>
		</tr>
		<tr>
			<td valign="top">
				<table class="table_title2">
					<tr>
						<td class="title_info">
							<table class="table" style="width: 800px;">
								<tr>
									<td width="30" valign="bottom" onclick="showHidden('4')">&nbsp;<img id="img4" src="./images/nolines_minus.gif"></td>
									<td width="150">活动</td>
									<td>
										<input class="btn1" type="button" value=" 详 情 " onclick="viewSaleRecord()"/>&nbsp;&nbsp;
										<c:if test="${customer.isWrite == '1'}">
										<input class="btn1" type="button" value=" 新 增 " onclick="addSaleRecordOne()"/>
										</c:if>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr id="4">
						<td>
							<table class="table_style" style="width: 800px;">
								<tr>
									<td class="title" width="50">操作</td>
									<td class="title" width="150">销售阶段</td>
									<td class="title" width="150">发生时间</td>
									<td class="title" width="450">主题</td>
								</tr>
								<c:forEach var="saleRecord" items="${customer.saleRecords}" begin="0" end="4">
								<tr>
									<td class="a_detail">
										<c:if test="${customer.isWrite == '1'}">
										<a href="javascript:updateSaleRecord();">编辑</a>
										</c:if>
									</td>
									<td>
										<c:forEach var="saleStage" items="${saleStages}">
											<c:if test='${saleRecord.saleStageId == saleStage.stageCode}'>${saleStage.stageName}</c:if>
										</c:forEach>
									</td>
									<td><fmt:formatDate value="${saleRecord.contactDate}" pattern="yyyy-MM-dd"/></td>
									<td>${saleRecord.subject}</td>
								</tr>
								</c:forEach>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="2"></td>
		</tr>
		<tr>
			<td valign="top">
				<table class="table_title2">
					<tr>
						<td class="title_info">
							<table class="table" style="width: 800px;">
								<tr>
									<td width="30" valign="bottom" onclick="showHidden('5')">&nbsp;<img id="img5" src="./images/nolines_plus.gif"></td>
									<td>附件信息</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr id="5" style="display: none;">
						<td>
							<table class="table_style" style="width: 800px;">
								<tr>
									<td class="title" width="50">操作</td>
									<td class="title" width="300" align="center">主题</td>
									<td class="title" width="225">建档人</td>
									<td class="title" width="225">建档时间</td>
								</tr>
								<c:forEach var="systemFile" items="${customerAddes}">
								<tr>
									<td class="a_detail">
										<a href="javascript:downloadAdded('${systemFile.relatedId}','${systemFile.id}');" target="main">下载</a>
									</td>
									<td>${systemFile.fileName}</td>
									<td>${systemFile.person}</td>
									<td><fmt:formatDate value="${systemFile.uploadDate}" pattern="yyyy-MM-dd"/></td>
								</tr>
								</c:forEach>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</form>
</body>
</html>